<?php
/***************************************************************************
 * 
 * Copyright (c) 2010 , Inc. All Rights Reserved
 * $Id$:MCUtilTest.php,2010/05/20 13:53:57 
 * 
 **************************************************************************/
 
 
 
/**
 * @file MCUtilTest.php
 * @author huqingping
 * @date 2010/05/20 13:53:57
 * @version 1.0 
 * @brief 
 *  
 **/

require_once dirname(__FILE__).'/../Curl.php';

$curl = new Curl();
$curl->asyncGet('http://192.168.0.249:8040/');
$curl->asyncPost('http://www.baidu.com/');
return;

class CurlTest extends PHPUnit_Framework_TestCase
{
	static $opt = array();//array(CURLOPT_VERBOSE=>0);
	function testGet()
	{
		$obj = MCUtil::load('Curl');
		$ret = $obj->get('http://127.0.0.1:8512/HapN/1',self::$opt);
		$this->assertTrue(isset($ret['header']));
		$this->assertTrue(isset($ret['content']));
		$this->assertTrue(isset($ret['cookie']));
	}

	function testPost()
	{
		$obj = MCUtil::load('Curl');
		$ret = $obj->post('http://127.0.0.1:8512/HapN/1',array('w'=>'a'),self::$opt);
		$this->assertTrue(isset($ret['header']));
		$this->assertTrue(isset($ret['content']));
		$this->assertTrue(isset($ret['cookie']));
	}
}






/* vim: set ts=4 sw=4 sts=4 tw=100 noet: */
?>
